<template>
  <view class="typeList">
		<image class="app_bg" src="https://sspzjz.oss-cn-shanghai.aliyuncs.com/yys/bj.png" />
    <view class="type_list">
      <view class="type_item" @click="toPages(item.path, item.type)"
       v-for="(item, index) in contentList" :key="index">
        <image class="type_item_bg" src="../../static/my/list_bg.png" />
        <view class="type_item_con">
					<view class="type_item_icon">
						<image src="../../static/my/older_icon.png" v-if="index == 0" />
						<image src="../../static/my/other_icon.png" v-else />
					</view>
					<view class="type_item_title">{{ item.title }}</view>
				</view>
      </view>
    </view>
  </view>
</template>

<script setup>
import { ref } from "vue";

const contentList = ref([
  { title: '八字详解', type: 13 },
  { title: '紫微斗数', type: 15 },
  { title: '八字合婚', type: 14 },
  { title: '算姻缘', type: 16 },
  { title: '起名字', type: 17 },
])
const toPages = function (path, type) {
	uni.navigateTo({
		url: '/pages/older/index?type=' + type
	});
}
</script>

<style lang="scss" scoped>
.typeList {  
  box-sizing: border-box;
  padding: 30rpx;
}
.type_item {
  position: relative;
  margin-bottom: 20rpx;
}
.type_item_bg {
  width: 100%;
  height: 100rpx;
}
.type_item_con {
  position: absolute;
  top: 50%;
  left: 44rpx;
  transform: translateY(-50%);
  display: flex;
  justify-content: flex-start;
  align-items: center;
  box-sizing: border-box;
  // padding: 28rpx 48rpx;
}
.type_item_icon {
  margin-right: 20rpx;
  width: 32rpx;
  height: 32rpx;
  &>image {
    width: 100%;
    height: 100%;
  }
}
.type_item_title {
  font-size: 32rpx;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 46rpx;
  color: rgba(117, 72, 59, 1);
}
</style>